(* vec3d.ml
 *
 * This file is part of camEngine
 * 
 * camEngine - A 3d motor for ocaml
 * Copyright (C) 2009 DAVY Guillaume <davyg2@gmail.com>
 *
 * camEngine is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * camEngine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with camEngine.  If not, see <http://www.gnu.org/licenses/>.
 *)

type t=float
class vec3d xi yi zi = object
	val mutable x = xi
	val mutable y = yi
	val mutable z = zi
	
	method get_x = x;
	
	method get_y = y;
	
	method get_z = z;
	
	method set_x xa = x <- xa;
	
	method set_y ya = y <- ya;
	
	method set_z za = z <- za;
	
	method move (p:vec3d) =
		x <- p#get_x +. x;
		y <- p#get_y +. y;
		z <- p#get_z +. z;
	
	method reverse =
		x <- 0. -. x;
		y <- 0. -. y;
		z <- 0. -. z;
	
	method swapxy =
		let s = x in
		x <- y;
		y <- s;
	
	method construct (p:vec3d) =
		x <- p#get_x;
		y <- p#get_y;
		z <- p#get_z;
		
end;;

